#!/usr/bin/python
# encoding=utf-8
import sys
import json
sys.path.append('..')
import apis.aep_device_command

if __name__ == '__main__':
    body_dict = {
        "content": {
            "dataType": 1,
            "payload": sys.argv[1]
        },
        "deviceId": "4fc8a881d2bd41aca0508b0e2b8a9fac",
        "operator": "41987",
        "productId": 10095070,
        "ttl": 7200,
        "level": 1
    }

    body = json.dumps(body_dict)
    #result = apis.aep_device_command.CreateCommand('dFI1lzE0EN2', 'xQcjrfNLvQ', '3883c8cf781f47e2a71802e6a57fd363', '{"content": {"dataType": 1,"payload": "5365ab32d"},"deviceId": "string","operator": "string","productId": 0,"ttl": 7200,"deviceGroupId": 100,"level": 1}')

    result = apis.aep_device_command.CreateCommand('lH9mzbCdau9', 'sOagPL0lGd', '530ca1b695fc4829a7a487c7cc98332f',body)
    print('result='+str(result))
'''
    result = apis.aep_device_command.QueryCommandList('dFI1lzE0EN2', 'xQcjrfNLvQ', 'cd35c680b6d647068861f7fd4e79d3f5', 10015488, '10015488test')
    print('result='+str(result))

    result = apis.aep_device_command.QueryCommand('dFI1lzE0EN2', 'xQcjrfNLvQ', 'cd35c680b6d647068861f7fd4e79d3f5', 10015488, '10015488test')
    print('result='+str(result))

    result = apis.aep_device_command.CancelCommand('dFI1lzE0EN2', 'xQcjrfNLvQ', 'cd35c680b6d647068861f7fd4e79d3f5', '{}')
    print('result='+str(result))
'''
